package com.ruoyi.project.wx.carCard.service;

import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
import com.ruoyi.project.wx.carCard.domain.CarCard;
import com.ruoyi.project.wx.carCard.mapper.CarCardMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("carCardService")
public class CarCardServiceImpl implements CarCardService {

    @Autowired
    private CarCardMapper carCardMapper;

    @Override
    public int insert(CarCard carCard) {
        return carCardMapper.insert(carCard);
    }

    @Override
    @DataScope(tableAlias = "w")
    public List<CarCard> carCardlist(CarCard carCard) {
        return carCardMapper.carCardlist(carCard);
    }

    @Override
    public int updateCarCardInfo(CarCard carCard) {
        return carCardMapper.updateCarCardInfo(carCard);
    }

    public int delCarCardByIds(String ids) {
        return carCardMapper.delCarCardByIds(Convert.toStrArray(ids));
    }

    @Override
    @DataScope(tableAlias = "w")
    public CarCard selectCarCardById(Long id) {
        return carCardMapper.selectCarCardById(id);
    }
}
